package com.server.llh.llhserverwork.bean;

import java.util.ArrayList;
import java.util.List;


/**
 * 支付清单
 * 
 * @author luodong
 *
 */
public class PayList {
	public String getOrderid() {
		return orderid;
	}

	public void setOrderid(String orderid) {
		this.orderid = orderid;
	}

	public String orderid;

	public AccountConstant.ConsumeType getConsumeType() {
		return consumeType;
	}

	public void setConsumeType(AccountConstant.ConsumeType consumeType) {
		this.consumeType = consumeType;
	}

	public AccountConstant.ConsumeType consumeType;
	
	public class PayItem {
		public AccountConstant.PayType paytype; // 支付类型

		public double ammount; // 金额
		public String id; // 卡或其他标识
		public String orgid;//发卡机构的ID
	}

	private List<PayItem> mPayitems = new ArrayList();

	public void add(String id, AccountConstant.PayType type, double ammount, String orgid) {
		PayItem item = new PayItem();
		item.id = id;
		item.paytype = type;
		item.orgid = orgid;
		item.ammount = ammount;
		mPayitems.add(item);
	}

	public boolean has(AccountConstant.PayType type) {
		for (PayItem payItem : mPayitems) {
			if (payItem.paytype == type)
				return true;
		}
		return false;
	}

	public List<PayItem> getAll() {
		return mPayitems;
	}

	public List<PayItem> getByPaytype(AccountConstant.PayType type) {
		List<PayItem> payitems = new ArrayList();
		for (PayItem payItem : mPayitems) {
			if (payItem.paytype == type)
				payitems.add(payItem);
		}
		return payitems;
	}
}
